Back to the Audio Object
Up to Table of Contents
Ahead to Combo Box Object

Check Box Object

A Check Box lets the user click to select or deselect an option. Check Boxes work independently of each other. For example, if you present users with three check boxes, they can switch any number of them On or Off. Use the Check Box button to draw a Check Box object. The button appears as follows:

Check Box Object Appearance

The following figure shows an example of how a Check Box might appear within Jamba.

Note that by default, a Check Box is not checked. If you want the object to be checked by default, set its Checked property to True. Use the Label property to control the text that appears in the object and use the Font property to control the character font and size. Use the TextColor property to control the color of the characters. The BackgroundColor property sets the color for the face of the object.

Capturing the User's Input

You have the ability to pre-set a Check Box so that it is On or Off by setting its Checked property to True or False, respectively. Similarly, when a user clicks on a Check Box at runtime, its Checked property is set to True or False, when the object is checked or unchecked. In effect, the applet uses the Checked property to "capture" the user's input. Your applet can use this information to set another property or method at runtime.

If you want to manipulate the captured value, you refer to it using the Object.Property syntax. For example, if you want to manipulate the value currently stored in the Checked property of CheckBox1, you would specify the value CheckBox1.Checked.

Acting on the User's Input

The applet can use the True or False value captured in the Checked property to set another property that uses a True or False value. For example, if the applet contains CheckBox1 and Graphic1, you can set Graphic1's Visible property using CheckBox1.Checked.

The following subsections describe how to use the Check Box object.

As mentioned previously, you have the ability to pre-set a Check Box so that it is On or Off by setting its Checked property to True or False, respectively. Similarly, when a user clicks on a Check Box at runtime, its Checked property is set to True or False, when the object is checked or unchecked.

In effect, the applet uses the Checked property to "capture" the user's input. Your applet can use this information to set another property that uses the values True or False. As an example, consider a Check Box labeled "Show Pictures." You can set up your applet so that the user can turn on the Check Box to view a graphic. You would set up the CheckBox1's To Do List so that when a user clicks on the Check Box, the Graphic1 object's Visible property is set to CheckBox1.Checked. Remember, CheckBox1.Checked is equal to True or False depending on whether the Check Box is On or Off. If Checked = True, Graphic1's Visible property is set to True. Otherwise, if Checked=False, Graphic1's Visible property is set to False.

For step-by-step instructions on how to create this applet see the section entitled "Lesson: Check Boxes."

Lesson: Check Boxes

In this lesson you set up a Check Box labeled "Show Picture" so that when the object is checked, a Graphic object becomes visible.

Note: A completed version of this lesson, called lesn_7, is located in the \Jamba\lessons directory.

First set up the Graphic object. You'll set its Filename property, but initially the object will not be visible (because the "Show Picture" Check Box will be unchecked).

Use the Filename property to set the name of the graphic to display.

Next you'll set up CheckBox1.

The Checked property is set to False which is appropriate for now.

Now you'll set up CheckBox1's To Do List so that it shows the Graphic when the user clicks.

The default event is Click. Because you want the To Do List action to occur when the user clicks, you'll leave the default as is.

When you set the What To Do field to Visible, the Value field automatically displays True and False radio buttons. Because you need to type a value instead of choosing from these two options, you circumvent the default radio button options.

A typing cursor appears in the Value field, allowing you to replace the True value.

Remember, CheckBox1.Checked is equal to either True or False, depending on whether the Check Box is On or Off.

Check Box Object Properties, Methods, and Events

The Check Box objects use the following properties, methods, and events:

Properties Methods Events
BackgroundColor MoveAndSize() Click
Checked SlideTo() Create
Enabled
 
Hide
Font
 
Show
Height
 
SlideToComplete
HowToHide
 
 
HowToShow
 
 
Label
 
 
Name
 
 
TextColor
 
 
Visible
 
 
Width
 
 
X
 
 
Y
 
 

Back to the Audio Object
Up to Table of Contents
Ahead to Combo Box Object